package com.zimmur.app.mocolink.domain.param;


import java.util.Date;

import com.zimmur.app.mocolink.domain.util.DateUtils;
import com.zimmur.app.mocolink.domain.util.NumberUtil;
import com.zimmur.app.mocolink.domain.util.StringUtils;

public class GoodsParamForManage {
	private Integer pageNo;
	private String keyword;
	private Integer categoryId;
	private String state;
	private String timeStart;
	private String timeEnd;
	private Integer brandId;
	private Short isSp;
	
	private Date timeStartDate;
	private Date timeEndDate;
	
	private Integer pageBeginNo;
	private Integer pageSize=10;
	
	public GoodsParamForManage(Integer pageNo){
		this.pageNo=pageNo;
		pageBeginNo=(pageNo-1)*pageSize;
	}
	public GoodsParamForManage(Integer pageNo,String keyword,Integer categoryId,Integer brandId,Short isSp,String state,String timeStart,String timeEnd){
		this.pageNo=pageNo;
		if(pageNo!=null && pageNo>0){
			pageBeginNo=(pageNo-1)*pageSize;
		}else{
			pageBeginNo=0;
		}
		this.keyword=StringUtils.isEmpty(keyword)?null:keyword.replace(" ", "");
		this.categoryId=NumberUtil.isEmpty(categoryId)?null:categoryId;
		this.brandId=NumberUtil.isEmpty(brandId)?null:brandId;
		this.isSp=NumberUtil.isEmpty(isSp)?null:isSp;
		this.state=StringUtils.isEmpty(state)?null:state;
		this.timeStart=timeStart;
		this.timeEnd=timeEnd;
		if(!StringUtils.isEmpty(timeStart)){
			timeStartDate=DateUtils.dateFormat(timeStart+" 00:00:00");
		}
		if(!StringUtils.isEmpty(timeEnd)){
			timeEndDate=DateUtils.dateFormat(timeEnd+" 23:59:59");
		}
	}
	public Integer getPageNo() {
		return pageNo;
	}
	public void setPageNo(Integer pageNo) {
		this.pageNo = pageNo;
	}
	public String getKeyword() {
		return keyword;
	}
	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}
	public Integer getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getTimeStart() {
		return timeStart;
	}
	public void setTimeStart(String timeStart) {
		this.timeStart = timeStart;
	}
	public String getTimeEnd() {
		return timeEnd;
	}
	public void setTimeEnd(String timeEnd) {
		this.timeEnd = timeEnd;
	}
	public Date getTimeStartDate() {
		return timeStartDate;
	}
	public void setTimeStartDate(Date timeStartDate) {
		this.timeStartDate = timeStartDate;
	}
	public Date getTimeEndDate() {
		return timeEndDate;
	}
	public void setTimeEndDate(Date timeEndDate) {
		this.timeEndDate = timeEndDate;
	}
	public Integer getPageBeginNo() {
		return pageBeginNo;
	}
	public void setPageBeginNo(Integer pageBeginNo) {
		this.pageBeginNo = pageBeginNo;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getBrandId() {
		return brandId;
	}
	public void setBrandId(Integer brandId) {
		this.brandId = brandId;
	}
	public Short getIsSp() {
		return isSp;
	}
	public void setIsSp(Short isSp) {
		this.isSp = isSp;
	}
	
}
